<?php
/*+----------------------------------------------------------------------
| 小老板
+----------------------------------------------------------------------
| Copyright (c) 2011 http://www.xiaolaoban.cn All rights reserved.
+----------------------------------------------------------------------
| Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+----------------------------------------------------------------------
| Author: hxl <plokplokplok@163.com>
+----------------------------------------------------------------------
| Create Date: 2014-01-30
+----------------------------------------------------------------------
 */
namespace common\api\carrierAPI;
/**
 +------------------------------------------------------------------------------
 * 物流商API抽象类
 +------------------------------------------------------------------------------
 * @category	vendors
 * @package		vendors/carrierAPI
 * @subpackage  Exception
 * @author		hxl<plokplokplok@163.com>
 * @version		1.0
 +------------------------------------------------------------------------------
 */
abstract class BaseCarrierAPI {

	/**
	 +----------------------------------------------------------
	 * 获取返回值方法
	 +----------------------------------------------------------
	 * @access protected
	 +----------------------------------------------------------
	 * @param $error		错误代码 0：为成功
	 * @param $data			数据
	 * @param $msg			错误消息
	 +----------------------------------------------------------
	 **/
	protected static function getResult($error = 0, $data, $msg) {
		return array('error' => $error, 'data' => $data, 'msg' => $msg);
	}

	/**
	 +----------------------------------------------------------
	 * 申请订单号
	 +----------------------------------------------------------
	 **/
	abstract public function getOrderNO($data);
	/**
	 +----------------------------------------------------------
	 * 取消跟踪号
	 +----------------------------------------------------------
	 **/
	abstract public function cancelOrderNO($data);
	/**
	 +----------------------------------------------------------
	 * 交运
	 +----------------------------------------------------------
	 **/
	abstract public function doDispatch($data);

	/**
	 +----------------------------------------------------------
	 * 申请跟踪号
	 +----------------------------------------------------------
	 **/
	abstract public function getTrackingNO($data);

	/**
	 +----------------------------------------------------------
	 * 打单
	 +----------------------------------------------------------
	 **/
	abstract public function doPrint($data);
}
